/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sree.tali.buscomp;

import com.sree.tali.dao.homepage.impl.ShowArticleDao;
import com.sree.tali.dao.homepage.impl.ShowArticleDaoImpl;
import com.sree.tali.hibernate.pojo.IpPojo;
import com.sree.tali.hibernate.pojo.UserPojo;
import com.sree.tali.pojo.ArticleTypes;
import com.sree.tali.pojo.Role;
import com.sree.tali.pojo.RoleArticleMapping;
import com.sree.tali.pojo.RoleUserMapping;
import com.sree.tali.pojo.UploadImagePojo;
import java.util.List;
import org.hibernate.Session;

/**
 *
 * @author sreenuv
 */
public class ShowArticleBusCompImpl implements ShowArticleBusComp {
    @Override
     public  List<UploadImagePojo> showHomeArticle(Session paramSession)
     {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         return articledao.showHomeArticle( paramSession);
     }
     @Override
     public  List<UploadImagePojo> showInactiveArticle( Session paramSession)
     {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         return articledao.showInactiveArticle(paramSession);
     }
    @Override
     public UploadImagePojo showArticle(Session paramSession , String articleName)
     {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         return articledao.showArticle(paramSession, articleName);
     } 
       @Override
      public List<UploadImagePojo> viewArticles(Session paramSession , UploadImagePojo uploadimagepojo)
      {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
          return articledao.viewArticles(paramSession, uploadimagepojo);
   
      }

        @Override
      public void updateArticle (  Session paramSession , UploadImagePojo uploadimagepojo)
     {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         articledao.updateArticle(paramSession, uploadimagepojo);
     }

    @Override
     public List<UploadImagePojo> showTitles(  Session paramSession , String articleType)
     {
          ShowArticleDao articledao = new ShowArticleDaoImpl();
         return articledao.showTitles(paramSession, articleType);
     }
    @Override
     public List<UploadImagePojo> showRelatedArticle(Session paramSession ,UploadImagePojo uploadhomeimage)
     {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         return articledao.showRelatedArticle(paramSession, uploadhomeimage);
     }
    @Override
      public List<UploadImagePojo> showRecentArticle(Session paramSession ,UploadImagePojo uploadhomeimage)
      {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         return articledao.showRecentArticle(paramSession, uploadhomeimage);
      }
    @Override
     public List<UploadImagePojo> showMostViewedArticle(Session paramSession ,UploadImagePojo uploadhomeimage)
      {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         return articledao.showMostViewedArticle(paramSession, uploadhomeimage);
      }
    @Override
     public void createUser(Session paramSession ,UploadImagePojo uploadhomeimage)
      {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         articledao.createUser(paramSession, uploadhomeimage);
           }
     @Override
    public void addIp(Session paramSession ,UploadImagePojo uploadhomeimage)
    {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         articledao.addIp(paramSession, uploadhomeimage);
       
    }
     public List<IpPojo> showIps(  Session paramSession )
     {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         return articledao.showIps(paramSession);
    
     }
    public List<UserPojo> showUsers(  Session paramSession)
    {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         return articledao.showUsers(paramSession);
   
    }
    public void inactivateUser(Session paramSession ,int id)
    {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         articledao.inactivateUser(paramSession, id);
   
    }
    public void inactivateIp(Session paramSession ,int id)
    {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         articledao.inactivateIp(paramSession, id);
   
    }
    public void deleteAllIps(Session paramSession)
    {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         articledao.deleteAllIps(paramSession);
   
    }
    public void inactivateArticle(Session paramSession ,int id)
    {
        ShowArticleDao articledao = new ShowArticleDaoImpl();
         articledao.inactivateArticle(paramSession, id);
   
    }
     public void activateArticle(Session paramSession ,int id , int articleNumber)
     {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         articledao.activateArticle(paramSession, id,articleNumber);
   
     }
      public UploadImagePojo editArticle(Session paramSession ,int id)
      {
           ShowArticleDao articledao = new ShowArticleDaoImpl();
           return  articledao.editArticle(paramSession, id);
   
      }
   
    @Override
     public void removeArticle(Session paramSession ,int id)
     {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
             articledao.removeArticle(paramSession, id);
    
     }
    @Override
     public void removeUser(Session paramSession ,int id)
     {
          ShowArticleDao articledao = new ShowArticleDaoImpl();
            articledao.removeUser(paramSession, id);
   
     }
    @Override
     public void removeIp(Session paramSession ,int id)
     {
          ShowArticleDao articledao = new ShowArticleDaoImpl();
             articledao.removeIp(paramSession, id);
   
     }
     @Override
     public void addArticleTypes(Session paramSession , UploadImagePojo uploadImagePojo )
     {
        ArticleTypes articletypes = new ArticleTypes();
        ShowArticleDao articledao = new ShowArticleDaoImpl();
        articletypes.setArticleType(uploadImagePojo.getArticleType());
        articledao.addArticleTypes(paramSession, articletypes);  
     }
       @Override
     public List<ArticleTypes> viewArticleTypes(Session paramSession)
     {
        ShowArticleDao articledao = new ShowArticleDaoImpl();
        return articledao.viewArticleTypes(paramSession);
     }
       @Override
     public void removeArticleTypes(Session paramSession , int id)
     {
        ShowArticleDao articledao = new ShowArticleDaoImpl();
         articledao.removeArticleTypes(paramSession , id);
     }
          

    
     
      public void addRole(Session paramSession , UploadImagePojo uploadImagePojo )
      {
          Role role = new Role();
          role.setRoleName(uploadImagePojo.getRole());
          ShowArticleDao articledao = new ShowArticleDaoImpl();
          articledao.addRole(paramSession, role);
      }
     public List<Role> viewRole(Session paramSession )
     {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         return articledao.viewRole(paramSession);
     }
     public void removeRole(Session paramSession , int id)
     {
          ShowArticleDao articledao = new ShowArticleDaoImpl();
          articledao.removeRole(paramSession, id);
     
     }
     public void addRoleUser(Session paramSession , UploadImagePojo uploadImagePojo )
     {
          RoleUserMapping roleuser = new RoleUserMapping();
          roleuser.setRoleName(uploadImagePojo.getRole_role());
          roleuser.setUser(uploadImagePojo.getRole_user());
          ShowArticleDao articledao = new ShowArticleDaoImpl();
          articledao.addRoleUser(paramSession, roleuser);
     }
     public List<RoleUserMapping> viewRoleUser(Session paramSession )
     {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         return articledao.viewRoleUser(paramSession);
         }
     public void removeRoleUser(Session paramSession , int id)
     {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         articledao.removeRoleUser(paramSession,id);
    
     }
     public void addRoleArticle(Session paramSession , UploadImagePojo uploadImagePojo )
     {
          RoleArticleMapping rolearticle = new RoleArticleMapping();
          rolearticle.setRoleName(uploadImagePojo.getRole_role());
          rolearticle.setArticle(uploadImagePojo.getRole_article());
          ShowArticleDao articledao = new ShowArticleDaoImpl();
          articledao.addRoleArticle(paramSession, rolearticle);
     }
     public List<RoleArticleMapping> viewRoleArticle(Session paramSession )
     {
         ShowArticleDao articledao = new ShowArticleDaoImpl();
         return articledao.viewRoleArticle(paramSession);
        }
     public void removeRoleArticle(Session paramSession , int id)
     {
          ShowArticleDao articledao = new ShowArticleDaoImpl();
         articledao.removeRoleArticle(paramSession,id);
   
     }

}
